<template>
  <div class="contentHeader">
    <div class="text">
      <a-icon v-if="showBack" class="back" @click="goBack" type="rollback"  title="返回上一页"/>
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name:'contentHeader',
  props:{
    showBack:{
      type:Boolean,
      default:false
    }
  },
  methods: {
    goBack(){
      this.$router.go(-1)
    }
  },
}
</script>

<style scoped>
  .contentHeader{
    width: 100%;
    background-color: #ffffff;
    height: 60px;
  }
  .contentHeader .text{
    font-size: 20px;
    font-weight: 500;
    color: #17233d;
    padding: 14px 32px 0 32px;
  }
  .contentHeader .text .back{
    margin-right: 10px;
    cursor: pointer;
    transition: color .3s ease-in-out;
  }
  .contentHeader .text .back:hover{
    color: #1890ff;
  }
</style>